AcquireLink
TheAcquireLink
method returns a reference to the link object whose data is stored in the specified storage unit or that can be constructed from the given link specification.
ODLink AcquireLink (in ODStorageUnitID id, in ODLinkSpec linkSpec);
id
- The ID of the storage unit providing the link data, or
kODNULLID
if the link is to be constructed.linkSpec
- A reference to a link-specification object from which the link is to be constructed, or
kODNULL
is theid
parameter is not null.- return value
- A reference to the specified link object.
DISCUSSION
If your part is the destination of a link, you call this method to create a link object; you also call this method in your part'sInitPartFromStorage
method to re-create the link object from its stored data.If the
id
parameter is not null, thelinkSpec
parameter is ignored. In that case, theid
parameter must be the ID of the link object's storage unit, and this method re-creates the link object from the content of the specified storage unit.If the
id
parameter is null, thelinkSpec
parameter must be a link-specification object returned by a previous call to theCreateLinkSpec
method. In that case, this method uses the information in the link-specification object to construct the link object.This method increments the reference count of the returned link object. When you have finished using that link object, you should call its
Release
method.EXCEPTIONS
kODErrCannotAcquireLink
- Cannot re-create the requested link object from the specified storage unit or link-specification object.
kODErrInsufficientInfoInParams
- No link object was specified; the
id
parameter iskODNULLID
and thelinkSpec
parameter iskODNULL
.SEE ALSO
TheODStorageUnitID
type (page 903).
TheODDraft::CreateLinkSpec
method (page 167).
TheODPart::InitPartFromStorage
method (page 530).
TheODLink
class (page 348).
TheODLinkSpec
class (page 390).
"Creating a Link at the Destination" on page 384 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.
"Reading Links in InitPartFromStorage" on page 394 in OpenDoc Programmer's Guide.
"Reading Links for Data Transfer" on page 395 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help